/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 adv_object_deletion_marker.cpp

	$Header: /heroes4/adv_object_deletion_marker.cpp $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "adv_object_deletion_marker.h"

#include "adv_object_type.h"
#include "adventure_map.h"
#include "object_registration.h"
#include "sized_int_types.h"
#include "streambuf_operators.h"

// --------------------------------------------------------------------------
// Unnamed namespace
// --------------------------------------------------------------------------

namespace
{

	int const k_current_map_version = 1;

	t_object_registration< t_adv_object_deletion_marker >
		g_registration( k_adv_object_deletion_marker );

} // Unnamed namespace

// --------------------------------------------------------------------------
// t_adv_object_deletion_marker members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
void t_adv_object_deletion_marker::place( t_adventure_map &	 	 map,
										  t_adv_map_point const& point )
{
	map.add_deletion_marker( m_identifier, point );
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
bool t_adv_object_deletion_marker::read_from_map(
	std::streambuf &		stream,
	t_progress_handler * )
{
	int format_version = get< t_uint16 >( stream );
	if ( format_version < 0 || format_version > k_current_map_version )
		return false;

	return format_version < 1 || read_string16( stream, m_identifier );
}
